package com.zros.modules.business.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 课程表
 * </p>
 *
 * @author pangyinqiang
 * @since 2019-04-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_info_course")
@ApiModel(value="Course对象", description="课程表")
public class Course extends Model<Course> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "course_id", type = IdType.ID_WORKER)
    private Long courseId;

    @ApiModelProperty(value = "科系id")
    private Long departmentId;

    @ApiModelProperty(value = "课程名称")
    private String courseName;

    @ApiModelProperty(value = "创建者")
    private Long creator;

    @ApiModelProperty(value = "创建记录时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新者")
    private Long operator;

    @ApiModelProperty(value = "更新记录时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "删除标记 0:未删除 1:已删除")
    @TableLogic
    private String delFlag;

    @ApiModelProperty(value = "备注")
    private String remark;

    //查询列表根据userId查询所属校区
    @TableField(exist = false)
    private String userId;
    
    //下拉框查询时 前台传orgId查询校区数据 定义为long是为了查询时清空判断不会出错，String会出错
    @TableField(exist = false)
    private Long orgId;

    @Override
    protected Serializable pkVal() {
        return this.courseId;
    }
    
    public String getStringCourseId() {
        return courseId.toString();
    }
}
